package Pattern.StatePattern.Program.programfive;

public class Context {
    public static State soldState = new SoldState();
    public static State soldoutState = new SoldOutState();
    public static State noMoney = new NoMoneyState();
    public static State hasMoney = new HasMoneyState();
    private State state;

    public Context(State state) {
        this.state = state;
    }

    public Context() {
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }

    void MoneyNotify(){
        state.select();
        state.insertMoney();
        state.ejectMoney();
        state.dispense();
    }
}
